Skip to content

Convert a dataset to another type ​

The labels of a dataset can serve another kind of model. Boxes around defects already say which images are good and which are not; masks already say where each object is. In this guide you turn an object detection dataset of jars into a classification dataset, without labeling anything again.

What you will learn

  • Which types a dataset can be converted to
  • How the tag hierarchy decides the class of each image
  • Where the converted dataset appears and what it holds

Before you start

You need a labeled dataset of type object detection, oriented boxes, image segmentation or anomaly detection. The conversion does not change it: it creates a new dataset.

1. Look at the labels you have ​

Here the object detection dataset has nine jars: three with a box around a crack, two with boxes around stains, and four good jars without any box. A classification model needs one tag per image instead: «crack», «stain» or good.

Look at the labels you have

2. Open «Convert» ​

Open the dataset, click «More options» at the top right and choose «Convert». The option is grey in classification datasets, which cannot be converted.

Open «Convert»

3. Choose the new type ​

Open «Select new dataset type». What it offers depends on the type of the dataset:

FromTo
Object detectionClassification
Oriented boxesObject detection or classification
Image segmentationObject detection (each mask becomes a box) or classification
Anomaly detectionClassification

Choose the new type

4. Set the tag hierarchy ​

A classification image has one tag, but a detection image can hold boxes of several tags. «Indicate tags hierarchy» decides which one wins: an image takes the tag of «Priority 1» if it has a box of it, otherwise that of «Priority 2», and so on. Images without any box become «OK». Here a crack outranks a stain.

Set the tag hierarchy

5. Name the new dataset ​

Type the name of the new dataset: letters, numbers and underscores, up to 32 characters.

6. Start the conversion ​

Click «Convert». A job in the cloud copies the images into the new dataset with their new tags. It has no progress bar and takes a few minutes, about eight for these nine images; the original dataset stays as it is.

Start the conversion

7. Close the dialog ​

In release 1.8.15 the dialog says «The conversion could not be started» although the job has started: the answer of the cloud is read as a failure. Close it with «Cancel». «Retry» would start a second conversion into a dataset with the same name.

8. Find the new dataset ​

When the job ends, the new dataset appears in «Datasets», with the type you chose. Its overview says when it was imported.

Find the new dataset

9. Open it ​

Open the new dataset. It is a classification dataset with the same images and one tag each: the three cracked jars are «crack», the two stained ones «stain», and the four jars without boxes «OK». The boxes themselves are gone: a classification dataset has no use for them.

Open it

10. Check the images ​

Click «Labeling» to see the images with their new tags. The dataset is ready for a classification model, or for more images and labels.

Check the images

Good to know ​

  • The original is not touched. The conversion reads the dataset and writes a new one; you can convert the same dataset again with another hierarchy or name.
  • Pending images count. Images not yet reviewed are converted too. In a classification target, an image without boxes or masks becomes «OK».
  • The split is not kept. The new images arrive «Predetermined», so the next training makes its own split.
  • Classification datasets cannot be converted. «Convert» is grey for them.
  • Release 1.8.15 shows an error when the conversion starts. Ignore it and close the dialog with «Cancel»: the dataset arrives a few minutes later. «Retry» starts a second conversion.

Next steps ​

Recorded on Rosepetal release 1.8.15.